import 'package:color_dart/color_dart.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/components/a_button/index.dart';
import 'package:im_flutter_sdk_example/utils/global.dart';

class LoginMethod extends StatelessWidget {
  const LoginMethod({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Stack(
      children: [
        Container(
          color: Colors.white,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: <Widget>[
              Stack(
                alignment: Alignment.center,
                children: [
                  Container(
                    height: 250,
                    width: double.infinity,
                    decoration: BoxDecoration(
                      // color: Colors.blue,
                      image: DecorationImage(
                        image: AssetImage(
                            "lib/assets/images/mine/login-head-bg.png"),
                        fit: BoxFit.cover,
                      ),
                    ),
                    child: null,
                  ),
                  Positioned(
                      child: Container(
                          child: Center(
                              child: Text('登录',
                                  style: TextStyle(
                                      color: rgba(0, 0, 0, 1),
                                      fontSize: 18,
                                      fontWeight: FontWeight.bold,
                                      decoration: TextDecoration.none)))),
                      top: 50),
                  Positioned(
                      child: Image.asset(
                        'lib/assets/images/logo.png',
                        width: 130,
                        fit: BoxFit.cover,
                      ),
                      bottom: 20),
                ],
              ),
              Container(
                padding: EdgeInsets.symmetric(horizontal: 20),
                margin: EdgeInsets.only(top: 50),
                child: AButton.normal(
                    width: double.infinity,
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: [
                        Image.asset('lib/assets/images/weixin-white.png',
                            width: 25, height: 22),
                        Padding(
                          padding: const EdgeInsets.only(left: 10),
                          child: Text('微信一键登录'),
                        ),
                      ],
                    ),
                    bgColor: rgba(109, 194, 85, 1),
                    type: 'primary',
                    onPressed: () {
                      G.toast("开发中");
                    }),
              ),
              Container(
                padding: EdgeInsets.symmetric(horizontal: 20),
                margin: EdgeInsets.only(top: 25),
                child: AButton.normal(
                    width: double.infinity,
                    child: Text('手机号登录/注册'),
                    color: hex('#fff'),
                    bgColor: rgba(42, 125, 250, 1),
                    borderColor: rgba(136, 175, 213, 1),
                    onPressed: () => G.pushNamed('/login_password')),
              ),
              // Container(
              //   padding: EdgeInsets.symmetric(horizontal: 20),
              //   margin: EdgeInsets.only(top: 25),
              //   child: AButton.normal(
              //       width: double.infinity,
              //       child: Text('手机号绑定'),
              //       color: hex('#fff'),
              //       bgColor: rgba(42, 125, 250, 1),
              //       borderColor: rgba(136, 175, 213, 1),
              //       onPressed: () => G.pushNamed('/login_bind')),
              // ),
              // Container(
              //   padding: EdgeInsets.symmetric(horizontal: 20),
              //   margin: EdgeInsets.only(top: 25),
              //   child: AButton.normal(
              //       width: double.infinity,
              //       child: Text('手机号登录'),
              //       color: hex('#fff'),
              //       bgColor: rgba(42, 125, 250, 1),
              //       borderColor: rgba(136, 175, 213, 1),
              //       onPressed: () => G.pushNamed('/login_phone')),
              // ),
              // Container(
              //   padding: EdgeInsets.symmetric(horizontal: 20),
              //   margin: EdgeInsets.only(top: 25),
              //   child: AButton.normal(
              //       width: double.infinity,
              //       child: Text('感兴趣栏目'),
              //       color: hex('#fff'),
              //       bgColor: rgba(42, 125, 250, 1),
              //       borderColor: rgba(136, 175, 213, 1),
              //       onPressed: () => G.pushNamed('/interest_select')),
              // ),
              // Container(
              //   padding: EdgeInsets.symmetric(horizontal: 20),
              //   margin: EdgeInsets.only(top: 25),
              //   child: AButton.normal(
              //       width: double.infinity,
              //       child: Text('row测试'),
              //       color: hex('#fff'),
              //       bgColor: rgba(42, 125, 250, 1),
              //       borderColor: rgba(136, 175, 213, 1),
              //       onPressed: () => G.pushNamed('/example_arow')),
              // ),
            ],
          ),
        ),
        Positioned(
            child: Container(
                width: G.screenWidth(),
                child: Center(
                    child: Text.rich(TextSpan(
                        style: TextStyle(
                            decoration: TextDecoration.none,
                            fontWeight: FontWeight.normal),
                        children: [
                      TextSpan(
                          text: '登录代表您已同意',
                          style: TextStyle(
                              color: rgba(163, 163, 163, 1), fontSize: 12)),
                      TextSpan(
                          text: '《联合科创平台会员服务协议》',
                          style: TextStyle(
                              color: rgba(25, 109, 236, 1), fontSize: 12))
                    ])))),
            bottom: 40),
      ],
    );
  }
}
